<template>
<!-- 商品详情 -->
	<view>
		<van-pull-refresh
			:pulling-text="i18n.common.pulling_text"
			:loosing-text="i18n.common.loosing_text"
			:loading-text="i18n.common.loading"
			:success-text="i18n.common.no_more"
			v-model="isLoading"
			@refresh="onRefresh">
			<view class="body">
				<!-- :style="{'height':scrollH+'px'}" -->
				<scroll-view class="uni-tab-bar" :style="{'height':scrollH+'px'}" scroll-y="true">
					<!--轮播图-->
					<view class="topbody bg-white">
						<!--轮播图组件-->
						<view class="swiper" v-if="imgUrls.length>0">
							<swiper indicator-dots="true" :autoplay="true" circular :interval="3000" :duration="1000"
								indicator-color="rgba(255,255,255,0.6)" indicator-active-color="#fff">
								<block v-for="(item,index) in imgUrls" :key="index">
									<swiper-item>
										<image mode="heightFix" :src="item || defaultImg" lazy-load></image>
									</swiper-item>
								</block>
							</swiper>
						</view>
						<!--标题内容-->
						<view class="bodyTitle font-lg my-1 px-2" style="padding-top: 30upx;">
							<text class="f13">
								({{goodDetail.good_period}}<text class="f10">{{i18n.common.expect}}</text>){{goodDetail.good_name}}
							</text>
						</view>
						<view v-if="goodDetail.status=='进行中'" class="bodyItem font-md my-1 px-2 d-flex a-center j-sb">
							<text class="text-light-muted">
								<!-- 价值： -->
								<text class="f10">{{i18n.home_page.good_details.t2}}：</text> ₹{{goodDetail.good_price}}
							</text>
							<text class="text-warning">
								<!-- 剩 -->
								<text class="f10">{{i18n.home_page.good_details.t3}}</text>{{goodDetail.need_people-goodDetail.now_people}}/
								<!-- 总 --> <!-- 次 -->
								<text class="f10">{{i18n.home_page.good_details.t4}}</text>{{goodDetail.need_people}}<text class="f10">{{i18n.common.ci}}</text>
							</text>
						</view>
						<view v-else-if="goodDetail.status=='倒计时'||goodDetail.status=='已揭晓'"
							class="bodyItem font-md my-1 px-2 d-flex a-center j-end">
							<text class="text-light-muted f12">
								<!-- 本期总需 -->
								{{i18n.home_page.good_details.t5}}{{goodDetail.need_people}}
							</text>
						</view>
						
						<!--抽奖进度条-->
						<view v-if="goodDetail.status=='进行中'" class="my-1 px-2">
							<van-progress :show-pivot="showPivot" stroke-width="10px" color="rgb(243, 145, 43)"
								:percentage="goodDetail.progress==undefined?0:goodDetail.progress" />
						</view>
						
						<view class="my-3">
							<text style="font-weight: 700;" class="font-lg p-2 text-black f13">
								<!-- 本期抽奖进度 -->
								{{i18n.home_page.good_details.t6}}
							</text>
							<text style="font-weight: normal;" class="font-sm p-2 text-black">
								<text class="lg text-gray cuIcon-timefill f10"></text>
								<!-- 到时开奖 -->
								{{i18n.home_page.good_details.t7}}
							</text>
						</view>
						
						<!--步骤条-->
						<view class="bg-white" style="padding: 28upx 0;">
							<view class="cu-steps">
								<view class="cu-item f10" :class="index>=step?'':'text-warning'"
									v-for="(item,index) in numList" :key="index">
									<text class="num" :data-index="index + 1"></text>
									{{item.name}}
								</view>
							</view>
						</view>
						
						<!--倒计时条-->
						<view class="swipe-content p-2 d-flex flex-column a-center j-center"
							style="border-radius: 10rpx 10rpx 0 0;background-color: #ff976a;margin: 10rpx auto;width: 725rpx;">
							<view v-if="goodDetail.status=='进行中'||goodDetail.status=='倒计时'" class="text-center">
								<van-count-down v-if="goodDetail.status=='倒计时'" millisecond :time="time"
									format="HH:mm:ss:SSS" @finish="finish">
									<template #default="timeData">
										<span class="time-item">{{ timeData.hours }}</span>
										<span class="colon">:</span>
										<span class="time-item">{{ timeData.minutes }}</span>
										<span class="colon">:</span>
										<span class="time-item">{{ timeData.seconds }}</span>
										<span class="colon">:</span>
										<span class="time-item milliseconds">{{ timeData.milliseconds }}</span>
									</template>
								</van-count-down>
								<!--开奖提醒信息-->
								<text class="p-2 font-md f12 c-black c-w1" v-if="step==1">
									{{i18n.home_page.good_details.t8}}
									<!-- 本次抽奖会在到时或者人满时，进入开奖流程。 -->
								</text>
								<text v-else-if="step==3" class="p-2 font-md f13 c-black c-w1">
									<!-- 若出现网络问题等不可抗力因素，导致从香港时时彩网取值出现问题，系统将每隔1分钟，不停的进行取值，依旧取当日第 -->
									{{i18n.home_page.good_details.t9}}
									<!-- {{goodDetail.lottery_num_id}}
									{{i18n.home_page.good_details.t10}} -->
									<!-- 期的数据，直到取到为止，或30分钟取不到值将会退还积分。期间可能存在延迟开奖的情况，请熟知！ -->
								</text>
							</view>
							<view v-else-if="goodDetail.is_next=='y'" class="line-h-sm" style="width: 100%" >
								<view class="p-2 font-md f13 zj-box" v-if="step==4">
									<view class="f12 zj-text" style="color: #fff">
										<!-- 中奖号码： -->
										<text>
											{{i18n.home_page.good_details.t11}}：
										</text>
										{{goodDetail.win_num}}
									</view>
									<view class="f12 zj-text" style="color: #fff">
										<!-- 中奖人： -->
										<text>
											{{i18n.home_page.good_details.t12}}：
										</text>
										{{goodDetail.win_user.nick_name}}
									</view>
								</view>
							</view>
						</view>
					</view>
					<!--中奖公式提示-->
					<view class="my-2 bg-white p-2 d-flex flex-column j-sb">
						<view class="d-flex a-center j-sb">
							<text class="font-md font-weight text-black py-1" style="font-size: 14px">
								<!-- 中奖号码计算公式 -->
								{{i18n.home_page.good_details.t13}}
							</text>
							<!-- <text v-if="goodDetail.win_num" @click="infoComputed()" class="font-md text-light-muted py-1 f12">
								更多说明 -->
								<!-- {{i18n.home_page.good_details.t14}} -->
							<!--</text> -->
						</view>
						<text class="font-sm text-light-muted  f10">
							<!-- 取香港时时彩网指定期数的五位开奖号码 -->
							<!-- {{i18n.home_page.good_details.t15}} -->
							<!-- 取火币网指定时间点的BTC/USDT最高价位+最低价位各后三位拼接 -->
						</text>
						<view class="d-flex my-1">
							<!-- <view class="bg-light-secondary p-1 f12 no-line-h" style="border-radius: 15rpx 15rpx;"> -->
							<view class="p-1 f12 no-line-h" style="border-radius: 15rpx 15rpx;color: #e93323;">
								<!-- 最终计算结果 -->
								<!-- {{i18n.home_page.good_details.t46}} = 10000001 + ({{i18n.home_page.good_details.t44}} % {{i18n.home_page.good_details.t45}}) -->
								<view class="f12" style="padding-bottom: 20upx;">
									{{i18n.home_page.good_details.t48}}
								</view>
								<view class="f12">
									{{i18n.home_page.good_details.t49}}
								</view>
							</view>
							<!-- <image style="height: 30rpx;margin-left: 10rpx;margin-top: 15rpx;" mode="heightFix"
								src="/static/img/deng.png"></image>-->
							<!-- <text>+</text> -->
							<!-- <view class="ml-1 py-1 f10 no-line-h">10000001</view> -->
							<!--<image style="height: 30rpx;margin-left: 10rpx;margin-top: 15rpx;" mode="heightFix"
								src="/static/img/jia.png"></image> -->
							<!-- <view class="p-1 f10 no-line-h"> -->
								<!-- (时间取和 / 商品总需人次) -->
								<!-- ({{i18n.home_page.good_details.t44}} % {{i18n.home_page.good_details.t45}}) -->
								<!-- ({{i18n.home_page.good_details.t16}}) / -->
								<!-- ({{i18n.home_page.good_details.t16_update}}) / -->
							<!-- </view> -->
							<!-- <view class="d-flex flex-column a-center"> -->
								<!-- <text class="text-sm f10"> -->
									<!-- 抽奖总数 -->
									<!-- 商品总需人次 -->
									<!-- {{i18n.home_page.good_details.t17}} -->
								<!-- </text> -->
								<!-- <text class="text-sm text-warning">({{goodDetail.need_people}})</text> -->
							<!-- </view> -->
							<!-- <text class="py-1 f10" style="font-size: 10px;">
								 (取余数)
								({{i18n.home_page.good_details.t18}})
							</text> -->
						</view>
					</view>
					<!--中奖助手-->
					<view class="bg-white p-1 mb-1">
						<!-- 中奖助手 -->
						<van-cell :title="i18n.home_page.good_details.t23" icon="point-gift-o" @click="goTrendPic">
							<!-- 使用 right-icon 插槽来自定义右侧图标 -->
							<template #right-icon>
								<van-icon name="arrow" class="arrow py-1" />
							</template>
						</van-cell>
					</view>

					<view class="bg-white" style="height: auto;">
						<van-tabs v-model="active" @click="tabClick">
							<!-- 抽奖记录 -->
							<van-tab :title="i18n.home_page.good_details.t19">
								<lottery-detail-list @showDrawer="showDrawer" v-bind:goods_fight_id="goods_fight_id">
								</lottery-detail-list>
							</van-tab>
							<!-- 商品详情 -->
							<van-tab :title="i18n.home_page.good_details.t20">
								<!-- 商品详情 -->
								<view class='conter'>
									<jyf-parser :html="content" ref="article" :tag-style="tagStyle"></jyf-parser>
								</view>
							</van-tab>
							<van-tab :title="i18n.home_page.good_details.t21">
								<lottery-history-list :good_id="goodDetail.good_id"></lottery-history-list>
							</van-tab>
							<!-- <van-tab title="幸运晒单">幸运晒单</van-tab> -->
						</van-tabs>
					</view>
					
				</scroll-view>
			</view>
			<!--底部购买菜单-->
			<view class="footer bg-light">
				<view class="text-center p-1 f13">
					<text class="text-light-muted">
						<!-- 你还有 -->
						{{i18n.home_page.good_details.t24}}
						<text class="text-warning">{{userInfo.user_money}}</text>
						<!-- 积分，立即抽奖吧！ -->
						{{i18n.home_page.good_details.t25}}
					</text>
				</view>
				<van-goods-action v-if="goodDetail.is_next=='y'">
					<!-- <view class="ga-box"> -->
						<!-- <van-goods-action-button class="f13" type="warning" :text="`(${goodDetail.next_fight.good_period})${i18n.home_page.good_details.t26}...`"  @click="lotteryDetail(goodDetail.next_fight)" /> --> <!--期火热进行中-->
						<van-goods-action-button
							class="f13"
							type="danger"
							:text="`(${goodDetail.next_fight.good_period})${i18n.home_page.good_details.t26}...${i18n.home_page.good_details.t27}`"
							@click="lotteryDetail(goodDetail.next_fight)" />
					<!-- </view> -->
				</van-goods-action>
				<van-goods-action v-else>
					<view class="ga-box">
						<!-- <van-goods-action-icon icon="cart-o" text="购物车" @click="onClickIcon" /> -->
						<view @click="addShopCar(goodDetail)" class="d-flex flex-column a-center j-center">
							<image style="width: 44rpx;" mode="widthFix" src="/static/img/xinyuandan.png"></image>
							<text class="text-warning text-xs f12">
								<!-- 加入心愿单 -->
								{{i18n.home_page.good_details.t28}}
							</text>
						</view>
						<van-goods-action-button type="danger" class="f13" :text="i18n.home_page.good_details.t27" @click="clickLotteryBtn" />
					</view>
					
				</van-goods-action>
			</view>
			<!--点击抽奖按钮弹出的菜单-->
			<!-- 抽奖配置 -->
			<van-action-sheet :title="i18n.home_page.good_details.t29" v-model="show" style="height: 80%;">
				<view>
					<van-card price="2.00" :title="goodDetail.good_name">
						<template #price>
							<text style="margin-bottom: 20upx">
								<!-- 剩余 -->
								{{i18n.cart_page.t9}}
								<text class="text-warning">{{goodDetail.need_people-goodDetail.now_people}}</text>
								<!-- 人次 -->
								{{i18n.cart_page.t8}}
							</text>
						</template>
						<template #thumb>
							<!-- 抽奖配置图片 -->
							<view class="border kj-img" style="width: 160rpx; height: 160rpx;">
								<image class="" :src="goodDetail.good_header || defaultImg" mode="widthFix"></image>
							</view>
						</template>
					</van-card>
				</view>
				<!-- <view class="num-select d-flex p-1 a-center j-sb mt-2"> -->
				<view class="num-select p-1 j-sb mt-2">
					<view>
						<!-- 快捷选择: -->
						<van-divider content-position="left">{{i18n.home_page.good_details.t30}}</van-divider>
						<!-- <text class="text-black f13">
							快捷选择:
							{{i18n.home_page.good_details.t30}}
						</text> -->
					</view>
					
					<view class="kj-box">
						<van-button
						@click="changeNum(Math.round((goodDetail.good_price/10)==0?1:((goodDetail.good_price/10))*(index+1)/goodDetail.good_single_price,index))"
						:class="{'active':currentSort==index}" v-for="(item,index) in 3" :key="index" class="num_active"
						style="width: 110rpx;height: 40rpx;margin-right: 10upx;" size="small" round plain type="warning">
						{{Math.round((goodDetail.good_price/10)==0?1:((goodDetail.good_price/10))*(index+1)/goodDetail.good_single_price)}}
						</van-button>
						<van-button @click="changeNum(goodDetail.need_people-goodDetail.now_people,3)"
						:class="{'active':currentSort==3}" class="num_active" style="width: 150rpx;height: 40rpx;"
						size="small" round plain type="warning">
						<!-- 包尾 -->
						{{i18n.home_page.good_details.t31}}
						</van-button>
					</view>
					
				</view>
				<view class="p-1 f13">
					<view>
						<!-- 快捷选择: -->
						<van-divider content-position="left">{{i18n.home_page.good_details.t32}}</van-divider>
					</view>
					<view class="kj-box">
						<van-stepper v-model="buyNum" />
					</view>
					<!-- <text class="pr-1">
						 购买次数
						{{i18n.home_page.good_details.t32}}
					</text> -->
					<!-- <van-stepper v-model="buyNum" /> -->
				</view>
				<view class="d-flex p-1">
					<!-- 				<text class="pr-1">最小购买数量:200次</text> -->
				</view>

				<view class="footer bg-light">
					<view class="text-center p-1 f12">
						<text class="text-light-muted f12">
							<!-- 你还有 -->
							{{i18n.home_page.good_details.t24}}
							<text class="text-warning">{{userInfo.integral}}</text>
							{{i18n.home_page.good_details.t25}}
							<!-- 积分，立即抽奖吧！ -->
						</text>
					</view>
					<van-goods-action>
						<view class="ga-box">
							<!-- <van-goods-action-icon icon="cart-o" text="购物车" @click="onClickIcon" /> -->
							<view @click="addShopCar(goodDetail)" class="d-flex flex-column a-center j-center">
								<image style="width: 44rpx;" mode="widthFix" src="/static/img/xinyuandan.png"></image>
								<text class="text-warning text-xs f12">
									<!-- 加入心愿单 -->
									{{i18n.home_page.good_details.t28}}
								</text>
							</view>
							<van-goods-action-button
								type="danger"
								class="f12"
								:text="`${i18n.home_page.good_details.t27}(${i18n.home_page.good_details.t27}${buyNum*goodDetail.good_single_price}${i18n.home_page.good_details.t34})`"
								@click="goBuyLottery"
							/>
						</view>
					</van-goods-action>
				</view>
			</van-action-sheet>


		</van-pull-refresh>
		<!--显示中奖号码的抽屉-->
		<uni-drawer :width="dwidth" ref="showRight" mode="right" :mask-click="true"
			@change="change($event,'showRight')">
			<view class="scroll-view">
				<scroll-view class="scroll-view-box" scroll-y="true">
					<van-sticky>
						<view class="cu-list menu-avatar">
							<view class="cu-item">
								<view class="cu-avatar round lg"
									:style="'background-image:url('+selectedUser.user_header+');'">
								</view>
								<view class="content">
									<view class="text-grey" style="font-size: 10px;">
										{{selectedUser.nick_name}}</view>
									<view class="text-gray text-sm flex f12">
										<view class="text-cut" style="font-size: 10px;">
											<!-- <text class="cuIcon-infofill text-red  margin-right-xs"></text> -->
											{{selectedUser.fight_time}}
										</view>
									</view>
									<view class="d-flex" style="font-size: 10px;">
										<text>
											<!-- 购买 -->
											{{i18n.home_page.good_details.t22}}
										</text>
										<view class="text-warning font-md px-1" style="font-size: 10px;">
											{{selectedUser.count_num}}
											<!-- 次 -->
											{{i18n.common.ci}}
										</view>
									</view>
								</view>
							</view>
						</view>
					</van-sticky>
					<view>
						<!--抽奖号码面板-->
						<text
							style="display: inline-block;float: left; margin: 10px 5px;font-size: 12px;width: 98rpx;"
							v-for="(item,index) in selectedUser.fightRecordList" :key="index">
							{{item.fight_num}}
						</text>
					</view>
				</scroll-view>
			</view>
		</uni-drawer>
	</view>
</template>

<script>
	import {
		getLotteryGoodDetail,
		getFightRecordList,
		getAllUserParticipation,
		getHistoryList,
		payment,
		getUserInfo,
		addShopCar
	} from '@/api/lottery.js';


	import {
		toLogin,
		checkLogin
	} from '@/libs/login';

	import store from '@/store';

	import {
		Toast
	} from 'vant';
	import lotteryDetailList from "@/components/lotteryDetailList/lotteryDetailList.vue";
	import lotteryHistoryList from "@/components/lotteryHistoryList/lotteryHistoryList.vue";
	export default {
		components: {
			lotteryDetailList,
			lotteryHistoryList
		},
		data() {
			return {
				defaultImg: require("@/static/img/default_img.png"),
				goods_fight_id: "",
				stepperValue: 10,
				//是否显示sku菜单
				show: false,
				//抽屉宽度
				dwidth: 300,
				active: 0,
				//是否显示进度文字
				showPivot: false,
				//当前页码数
				currentPage: 1,
				loading: false,
				isLoading: false,
				finished: false,
				imgUrls: [],
				// numList: [{
				// 	name: '等待到时'
				// }, {
				// 	name: '准备取值'
				// }, {
				// 	name: '取值中'
				// }, {
				// 	name: '开奖'
				// }, ],
				num: 1,
				time: 30 * 60 * 60 * 1000,
				//屏幕滚动高度
				scrollH: 0,
				buyNum: 10,
				goodDetail: {},
				//抽奖列表信息
				fightRecordList: [],
				//被选择的用户
				selectedUser: {},
				//公开奖品的阶段值
				step: 1,
				//选择抽奖数量的第几个按钮索引
				currentSort: -1,
				//用户信息
				userInfo: {},
				content: ''
			}
		},
		onLoad(options) {
			console.log(options);
			this.goods_fight_id = options.id;
		},
		onShow() {
			//异步获取首页数据
			Promise.all([this.getGoodDetail()]);
			// let id = this.$route.query.id;
			// console.log(id);
			if (null == store.state.app.token || undefined == store.state.app.token || '' == store.state.app.token) {
				return;
			}
			this.getUserInfo();
		},
		created() {
			let res = uni.getSystemInfoSync();
			let footH = uni.upx2px(160);
			this.scrollH = res.windowHeight - footH;
			// var ws = plus.webview.currentWebview();
			// if (plus.os) {
			// 	uni.setNavigationBarColor({
			// 		frontColor: '#000000',
			// 		backgroundColor: '#F6CA4F'
			// 	});
			// }
		},
		// computed: {
		// 	// getImgUrls:function(){
		// 	// 	return ;
		// 	// }

		// },
		computed: {
			i18n() {
				return this.$t("index")
			},
			numList() {
				return [{
					name: this.i18n.home_page.good_details.t35 //'等待到时'
				}, {
					name: this.i18n.home_page.good_details.t36 // '准备取值'
				}, {
					name: this.i18n.home_page.good_details.t37 //'取值中'
				}, {
					name: this.i18n.home_page.good_details.t38 // '开奖'
				}, ]
			} 
			// loadTitle() {
			// 	this.i18n.common.loadmore	// 加载更多',
			// },
			// ...mapGetters(['isLogin'])
		},
		onReady: function() {
			uni.setNavigationBarTitle({
				title: this.i18n.home_page.good_details.t1
			});
		},
		methods: {
			//请求抽奖详情页面
			lotteryDetail(item) {
				console.log(item.id)
				uni.navigateTo({
					url: '/pages/lottery/good_details/good_details?id=' + item.id
				});
			},
			getGoodPeriod() {
				return "(" + goodDetail.next_fight.good_period + ")" +  this.i18n.home_page.good_details.t26; // 期火热进行中...
			},
			NumSteps() {
				this.num = this.num == this.numList.length - 1 ? 0 : this.num + 1
			},
			caculateStep() {
				if (this.goodDetail != null || this.goodDetail != undefined) {
					if (this.goodDetail.status == '已揭晓') {
						this.step = 4;
					} else if (this.goodDetail.status == '进行中') {
						this.step = 1;
					} else if (this.goodDetail.status == '倒计时') {
						this.step = 3;
					}
				}
			},
			caculateTime() {
				if (this.goodDetail != null || this.goodDetail != undefined) {
					let str = this.goodDetail.lottery_time;
					if (str != '' && str != undefined) {
						//str = str.replace(/-/g,'/');
						var date = new Date(str);
						console.log(date.getTime());
						var nowdate = new Date();
						let time = (date.getTime() - nowdate.getTime());
						if (time > 0) {
							this.time = time;
						}
						console.log(time / 1000)
					}

				}
			},
			tabClick(name, title) {
				//Toast(title);
				if (title == "历史中奖") {

				}
			}, // 抽屉状态发生变化触发
			change(e, type) {
				console.log((type === 'showLeft' ? '左窗口' : '右窗口') + (e ? '打开' : '关闭'));
				this[type] = e
			}, 
			// 打开窗口  抽奖记录窗口
 			showDrawer(data) {
				console.log('打开窗口  抽奖记录窗口', data)
				let e = data.status;
				let item = data.item;
				let that = this;
				this.$refs[e].open();
				this.selectedUser = item;
				getAllUserParticipation({
					user_id: item.user_id,
					goods_fight_id: this.goods_fight_id
				}).then(res => {
					this.$set(that.selectedUser, "fightRecordList", res.fightRecordList);
					console.log(that.selectedUser)
				});
			}, //点击抽奖按钮
			clickLotteryBtn() {
				//检测是否登录，若没登录则转向登录页面
				if (!store.state.app.token && !checkLogin()) {
					toLogin();
					return;
				}
				this.show = true;
			},
			changeNum(n, index) {
				this.buyNum = n;
				//this.stepperValue=n;
				this.currentSort = index;
			},
			getGoodDetail() {
				let that = this;
				getLotteryGoodDetail({
					goods_fight_id: this.goods_fight_id
				}).then(res => {
					that.goodDetail = res;
					that.imgUrls = that.goodDetail.good_imgs.split(",");
					that.caculateStep();
					that.caculateTime();
					that.content = res.content;
				
				});
			},
			getHistoryList() {
				let data = {
					good_id: this.goods_fight_id,
					page: this.currentPage,
					limitNum: 10
				};
			},
			onRefresh() {
				let that = this;
				setTimeout(function() {
					Promise.all([that.getGoodDetail()]).then(res => {
						that.isLoading = false;
					});
				}, 250);
			},
			infoComputed() {
				uni.navigateTo({
					url: '/pages/lottery/infoCompute/infoCompute?goods_fight_id=' + this.goods_fight_id
				});
			},
			/**
			 * 获取个人用户信息
			 */
			getUserInfo: function() {
				let that = this;
				getUserInfo().then(res => {
					that.userInfo = res;
					that.$store.commit("SETUID", res.id);
				});
			},
			tagStyle() {

			},
			goBuyLottery() {
				if (this.userInfo.user_money < this.buyNum * this.goodDetail.good_single_price) {
					// Toast('您的积分不足，请增加抽奖积分或减少抽奖次数');
					Toast(this.i18n.home_page.good_details.t39);
					return;
				}
				let data = {
					payType: "money",
					goods_fight_ids: this.goods_fight_id,
					goods_buy_nums: this.buyNum,
					is_shop_cart: "n",
					ticket_send_id: ""
				};
				payment(data).then(res => {
					let status = res.status;
					console.log(status)
					if (status == "0") {
						uni.navigateTo({
							url: "/pages/lottery/lotteryInfo/lotteryInfo?" + getApp().jsonToParam(res.data)
						})
					} else {
						Toast.fail(res.desc);
					}
				}).catch(e => {
					console.log(e)
					if (e != '')
						Toast.fail(e);
					else
						// Toast.fail('系统异常');
						Toast.fail(this.i18n.common.system_err);
				});
				// uni.navigateTo({
				// 	url:"/pages/lottery/lotteryInfo/lotteryInfo"
				// });
			},
			addShopCar(item) {
				//添加购物车
				let data = {
					goods_id: item.good_id
				};
				addShopCar(data).then(res => {
					if (res) {
						// Toast.success('成功加入心愿单');
						Toast.success(this.i18n.home_page.good_details.t40);
					} else {
						// Toast.fail('加入心愿单失败');
						Toast.fail(this.i18n.home_page.good_details.t41);
					}
				})
			},
			finish() {
				//倒计时结束重新获取抽奖信息
				this.getGoodDetail();
			},
			goTrendPic() {
				var that = this;
				uni.navigateTo({
					url: "/pages/lottery/trend_pic/index?id=" + that.goods_fight_id
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	@import 'vant/lib/index.css';
	/* 官方ui库 */
	@import "@/common/uni.css";
	@import "@/common/font.css";
	.swiper {
		position: relative;
		width: 100%;
		height: 375rpx;
		margin: 0 auto;
		overflow: hidden;
		/* #ifdef MP */
		z-index: 10;

		/* #endif */
		swiper,
		.swiper-item,
		image {
			width: auto;
			margin: 0 auto;
			height: 100%;
			display: block;
		}
	}

	.bodyTitle {
		word-break: break-all;
		font-weight: 500;
	}

	.time-item {
		display: inline-block;
		min-width: 32rpx;
		padding: 0 9rpx;
		color: #fff;
		font-size: 25rpx;
		text-align: center;
		background-color: #f3912b;
		border-radius: 4rpx;

	}

	.milliseconds {
		width: 60rpx;
	}

	.colon {
		margin: 0 10rpx;
	}

	.footer {
		width: 750rpx;
		height: 160rpx;
		position: fixed;
		left: 0;
		bottom: 0;
		right: 0;
	}

	.body {
		width: 750rpx;
	}

	.num-select {}

	.active {
		background: #f3912b;
		border-radius: 14px;
		text-align: center;

		.van-button__text {
			color: #fff;
		}
	}
	.no-line-h{
		line-height: normal;
	}
	uni-view {
    	// line-height: 1.8;
    	line-height: inherit;
	}
	.kj-img{
		// width: 88px;
		// height: 88px;
		padding: 8upx;
		display: flex;
		justify-content: center;
		align-items: center;
		box-sizing: content-box;
	}
	.van-divider{
		font-size: 13px;
	}
	.kj-box{
		width: 94%;
		margin: 0 auto;
		button{
			margin-right: 10upx;
		}
	}
	.ft-w{
		width: 120upx;
	}
	.ga-box{
		width: 96%;
    	margin: 0 auto;
    	display: flex;
	}
	/deep/ .van-tab{
		font-size: 13px !important;
	}
	// .f10{
	// 	font-size: 10px;
	// }
	// .content1 {
	// 	display: flex;
	// 	-webkit-box-align: center;
	// 	-ms-flex-align: center;
	// 	align-items: center;
	// }
	// .content1_header3_left1{
	// 	width: 16vw;
	// 	    height: 8vw;
	// 	    background: #f5f5f5;
	// 	    border-radius: .5333333333vw;
	// 	    -webkit-box-orient: vertical;
	// 	    -webkit-box-direction: normal;
	// 	    -ms-flex-direction: column;
	// 	    flex-direction: column;
	// 	    -webkit-box-pack: center;
	// 	    -ms-flex-pack: center;
	// 	    justify-content: center;
	// }
	// .content1_header3_left3{
	// 	    width: 17.0666666667vw;
	// 	    height: 7.4666666667vw;
	// 	    background: #fff;
	// 	    border-radius: .5333333333vw;
	// 	    border: 1px solid #eee;
	// 	    line-height: 7.4666666667vw;
	// 	    text-align: center;
	// 	    color: #666;
	// }
	// .content1_header3_left4{
	// 	    width: 4.2666666667vw;
	// 	    height: 4.2666666667vw;
	// 	    margin: 0 1.3333333333vw;
	// 	    text-align: center;
	// 	    -webkit-box-align: center;
	// 	    -ms-flex-align: center;
	// 	    align-items: center;
	// }
	// .content1_header3_left5{
	// 	    display: -webkit-box;
	// 	    display: -ms-flexbox;
	// 	    display: flex;
	// 	    color: #666;
	// 	    -webkit-box-align: center;
	// 	    -ms-flex-align: center;
	// 	    align-items: center;
	// }
 //   .content1_header3_left5 > .span1{
	// margin-left: 1.3333333333vw;
	// }
	
	// .content1_header3_left6{
		
	// }
	
	.zj-box{
		width: 100%;
		display: flex;
		justify-content: center;
		flex-direction: column;
		.zj-text{
			text-align: center;
		}
	}
</style>
